package com.hzdp.jobs;

import us.codecraft.webmagic.Spider;

import com.hzdp.enums.SourceCompany;
import com.hzdp.handles.rival.pipelines.DBPipeline;
import com.hzdp.handles.rival.processors.JDProcessor;

/**
 * 抓数据主job
 * <p/>
 * Created by lyp on 15/11/28.
 */
public class RivalDataJob {

    //private static final String START_URL = "http://list.jd.com/list.html?cat=1316,1381,1392&page=1";
    private static final String START_URL ="http://list.jd.com/list.html?cat=1316,1381,1389&page=1";
    private static final int COMPANY_ID = SourceCompany.JD.id;
    private static final String COMPANY_CATEGORY = "面部护肤-清洁";
    //static final String START_URL = "http://item.jd.hk/1954236604.html";

    public static void main(String[] args) {
        Spider.create(new JDProcessor())
                .thread(10)
                .addUrl(START_URL)
                .addPipeline(new DBPipeline(COMPANY_ID,COMPANY_CATEGORY))
                .run();
    }
}
